﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.IO;
using System.Net;

namespace Contract
{
    [ServiceContract(Namespace = "Contract")]
    public interface IDataUploader
    {

        [OperationContract]
        void Upload(MyFile mf);

        [OperationContract]
        Stream Download(string name, string pcn);

        //this one for agent to agent file transfer
        //       [OperationContract]
        //       Stream Download_deadlock(string name, string pcn);
        [OperationContract]
        Stream GetFiletoAgent(string name);

        [OperationContract]
        MyGroup CreateGroup(MyGroup mg);
       

        [OperationContract]
        void Delete(string name, string pcn);

        [OperationContract]
        MyUser[] GetGroupUser(string GroupID);


        [OperationContract]
        void Delete_deadlock(string name, string pcn);

        [OperationContract]
        MyUser Login(MyUser mu);

        [OperationContract]
        int Register(string Email, string Password, string Fname, string Lname, string Gender);

        [OperationContract]
        MyFile[] Getfilesinfo(string pcn);

       
        [OperationContract]
        MyGroup[] GetGroupInfo(string pcn);

        [OperationContract]
        int returnNumOfConnections();

        [OperationContract]
        void cpassword(string newpassword, string pcn);

        [OperationContract]
        void sendClientIP(IPAddress ip, string pcn);

        [OperationContract]
        void deactiveUser(string pcn);


        [OperationContract]
        bool addGroupMember(string memberID, string GroupID);


        [OperationContract]
        bool quitGroup(string PCN, string GroupID);

        [OperationContract]
        void Upload_Deadlock(MyFile mf);

        [OperationContract]
        MyFile[] GetGroupFiles(string groupID);

        [OperationContract]
        bool share(string GroupID, string FileID);

        [OperationContract]
        Stream Downloadgf(string FileID);


        //string CreateGroup(MyGroup mg);
    }


    [ServiceContract(Namespace = "Contract")]
    public interface ICallBack
    {

       // [OperationContract(IsOneWay = true)]
       // void SendMessageToClient(String msg);

        [OperationContract(IsOneWay = true)]
        void CallBackPushFileList(MyFile[] fl);

        [OperationContract(IsOneWay = true)]
        void CallBackPushGroupList();
        [OperationContract(IsOneWay = true)]
        void CallBackPushMemberList();
    }


}
